<include file="public@header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a >靓号列表</a></li>
            <li><a href="{:url('Liang/add')}">{:lang('ADD')}</a></li>
		</ul>
		<form class="well form-inline margin-top-20" method="post" action="{:url('Liang/index')}">
			状态： 
			<select class="form-control" name="status">
				<option value="">全部</option>
                <volist name="status" id="v">
                    <option value="{$key}" <if condition="input('request.status') neq '' && input('request.status') eq $key">selected</if>>{$v}</option>
                </volist>

			</select>
			位数：
			<select class="form-control" name="length">
				<option value="">全部</option>
                <volist name="length" id="v">
                    <option value="{$v['length']}" <if condition="input('request.length') neq '' && input('request.length') eq $v['length']">selected</if>>{$v['length']}</option>
                </volist>
			</select>
			会员： 
            <input class="form-control" type="text" name="uid" style="width: 200px;" value="{:input('request.uid')}"
                   placeholder="请输入会员ID">
			靓号：
            <input class="form-control" type="text" name="keyword" style="width: 200px;" value="{:input('request.keyword')}"
                   placeholder="请输入靓号">
			<input type="submit" class="btn btn-primary" value="搜索">
		</form>
        
		<form method="post" class="js-ajax-form" action="{:url('Liang/listOrder')}">
			<div class="table-actions">
                <button class="btn btn-primary btn-sm js-ajax-submit" type="submit">{:lang('SORT')}</button>
            </div>
		
			<table class="table table-hover table-bordered">
				<thead>
					<tr>
						<th>排序</th>
						<th>ID</th>
						<th>靓号</th>
						<th>所需{$configpub.name_coin}</th>
						<th>所需{$configpub.name_score}</th>
						<th>位数</th>
						<th>状态</th>
						<th>发布时间</th>
						<th>购买人</th>
						<th>购买时间</th>
						<th>{:lang('ACTIONS')}</th>
					</tr>
				</thead>
				<tbody>
					<foreach name="lists" item="vo">
					<tr>
                        <td><input name="list_orders[{$vo.id}]" class="input-order" type="text" value="{$vo.list_order}"></td>
						<td>{$vo.id}</td>
						<td>{$vo['name']}</td>
						<td>{$vo['coin']}</td>
						<td>{$vo['score']}</td>
						<td>{$vo['length']}</td>
						<td>{$status[$vo['status']]}</td>
						<td>{:date('Y-m-d H:i:s',$vo['addtime'])}</td>
						<if condition="$vo['uid'] eq '0'">
							<td>{$status[$vo['status']]}</td>
							<td>{$status[$vo['status']]}</td>
						<else/>
							<td>{$vo['userinfo']['user_nickname']} ({$vo['uid']})</td>
							<td>{:date('Y-m-d H:i:s',$vo['buytime'])}</td>
						</if>

						<td>
							<if condition="$vo['status'] eq '0'">
                            <a class="btn btn-xs btn-info js-ajax-dialog-btn" href="{:url('Liang/setstatus',array('id'=>$vo['id'],'status'=>'2'))}" >停售</a>
							<elseif condition="$vo['status'] eq '2'"/>
                             <a class="btn btn-xs btn-info js-ajax-dialog-btn" href="{:url('Liang/setstatus',array('id'=>$vo['id'],'status'=>'0'))}" >出售</a>
							</if>
							<if condition="$vo['status'] neq '1'">
                            <a class="btn btn-xs btn-primary" href='{:url("Liang/edit",array("id"=>$vo["id"]))}'>{:lang('EDIT')}</a>
							<a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('Liang/del',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
                            </if>
						</td>
					</tr>
					</foreach> 
				</tbody>
			</table>
			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>